<template>
    <div ref="myChart"/>
</template>

<script>

export default {
    name: "PieChartSimple",
    data: function () {
        return {
            seriesArray: []
        }
    },
    methods: {
        initSeries(optionData) {
            let _this = this;

            let myChart = this.$root.$echarts.init(this.$refs.myChart);
            let option = {
                backgroundColor: 'rgba(0,0,0,0)',
                // title: {
                //     text: optionData.titleText,
                //     subtext: optionData.subTitleText,
                //     left: optionData.titleLeft,
                // },
                tooltip: {
                    trigger: 'item'
                },
                series: [
                    {
                        name: '吞吐量占比',
                        type: 'pie',
                        radius: '50%',
                        data: optionData.seriesData,
                        label: {
                            color: '#38E5ED',
                            formatter: '{b|{b}:}{d|{d}}',
                            // formatter: '{b|{b}:}{d}%',
                            borderRadius: 4,
                            rich: {
                                b: {
                                    color: '#FFFFFF',
                                    fontSize: 12,
                                    // fontWeight: 'bold',
                                    lineHeight: 33
                                },
                                d: {
                                    color: '#38E5ED',
                                    fontSize: 12,
                                    // fontWeight: 'bold',
                                    lineHeight: 33
                                },
                            }
                        },
                        grid: {
                            containLabel: true
                        },
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };

            option && myChart.setOption(option);
        }
    }
}
</script>

<style scoped>

</style>